﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;

namespace Ex11
{

    /// <summary>
    /// Captured variables
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            int[] numbers = { 1, 2 };

            int factor = 10;

            IEnumerable<int> query = numbers.Select(n => n * factor);
            query.Dump("Dump #1");

            factor = 20;
            query.Dump("Notice both numbers are multiplied by 20, not 10");
            Console.ReadKey();
        }
    }
}
